/*
*
* */
Rsd.define('Rsd.Faith.templates.LouDongJiaoCunQingChe', {
    extend: 'Rsd.control.PrintArea',
    requires: [  'Rsd.control.Button'],
    xtype: 'tpl-bujiao',
    width: '100%',
    height: 500,
    size: {width: 130, height: 320},
    printBorder:true,
    rows: [
        {
            items: [
                {
                    colSpan: 5,
                    border:{right:false,bottom:false}
                },
                {
                    height: 6,
                    colSpan: 1,
                    text: '条形码',
                    align: 'center',
                    print: true,
                    border:{top:true,left:false,bottom:false,right:false},
                    style: {fontSize: '100%'}
                },
                {
                    id:'shengdingdanhao',
                    tag:'img',
                    colSpan: 3,
                    align: 'center',
                    print: true,
                    border:{top:true,left:false,bottom:false,right:true},
                },
            ]
        },
        {
            items: [
                {
                    height: 6,
                    colSpan: 9,
                    text: '镇江市住宅专项维修资金交款清册',
                    align: 'center',
                    print: true,
                    border:{top:false,left:true,bottom:false,right:true},
                    style: {fontSize: '150%',fontWeight:'bold'}
                }
            ]
        },
        {
            items: [
                {text: '开发公司名称', colSpan: 1,align: 'center', print: true, height: 4},
                {colSpan: 3,  align: 'center',  dataIndex: 'KFS' },
                {text: '幢编号', align: 'center', print: true},
                {colSpan: 4,   align: 'center',dataIndex:'LDBH' },

            ]
        },
        {
            items:[
                {width: 18,height: 4, text: '公安坐落',colSpan: 1, print: true, align: 'center'},
                {colSpan: 3,  align: 'center',dataIndex: 'DZ'},
                {width: 20, tag:'nobr',text: '所在行政区域',colSpan: 1, align: 'center', print: true},
                {width: 12,colSpan: 2,   align: 'center', dataIndex: 'XZQY'},
                {width: 8, tag:'nobr',text:'幢号(公安/施工)', print: true, align: 'center', style: {fontSize: '80%',transform:'scale(0.80)'} },
                {width: 8,align: 'center',dataIndex: 'LDH', },
            ]
        },
        {
            items:[
                {text: '项目编号',colSpan: 1, print: true, align: 'center'},
                {align: 'center',dataIndex:'XQBH'},
                {colSpan:2,text: '上市楼宇编号', print: true, align: 'center'},
                {colSpan:3,align: 'center',dataIndex: 'LYBH', style: {fontSize: '80%'}  },
                {colSpan: 1,text: '电梯情况', print: true, align: 'center'},
                {colSpan: 1, align: 'center',dataIndex:'DT'},
            ]
        },
        {
            items:[
                {text: '总层数/地上层数', tag:'nobr',colSpan: 1, print: true, align: 'center', style: {fontSize: '80%',transform:'scale(0.80)'}},
                {width: 12,align: 'center',text:'#=ZCS=#/#=DSCS=#'},
                {width: 14,text: '总户数', print: true, align: 'center'},
                {width: 14,align: 'center',dataIndex: 'ZHS', style: {fontSize: '80%'}  },
                {text: '总面积', print: true, align: 'center'},
                {colSpan: 4, align: 'center',text:'#=ZMJ=#m²'},
            ]
        },
        {
            items: [
                {height: 4, text: '应交维修资金', print: true, align: 'center'},
                {align: 'center',colSpan: 2,dataIndex: 'YJJE'},
                {
                    text: '大写',
                    align: 'center',
                    colSpan: 1,
                    print: true
                },
                {colSpan: 5,  align: 'center',dataIndex: 'JEDX'}
                ]
        },
        {
            items: [
                {text: '交款方式', print: true, align: 'center',rowSpan:3},
                {align: 'left',colSpan: 8,text: '开户行：#=KHH=#', border:{bottom:false}}
            ]
        },

        {
            items:[
                {align: 'left',colSpan: 8,text: '户  名：#=HM=#', border:{top:false,bottom:false}}
            ]
        },
        {
            items:[
                {align: 'left',colSpan: 8,text: '账  户：#=ZH=#', border:{top:false}}
            ]
        },
        {
            items: [
                {text: '监制单位', height: 4,print: true, align: 'center'},
                {colSpan: 2,  tag:'nobr',align: 'center',dataIndex:'JZDW',style:{fontSize:'80%',transform:'scale(0.80)'}},
                {
                    text: '填报日期',
                    align: 'center',
                    tag:'nobr',
                    print: true
                },
                {colSpan: 1, tag:'nobr',  align: 'center',dataIndex:'TBRQ',style:{fontSize:'80%'}},
                {colSpan: 2, tag:'nobr',text: '打印日期', print:false,align: 'center'},
                {colSpan: 2,  tag:'nobr', align: 'center',dataIndex: 'DYRQ'}]
        },
        {
            xtype:'list',
            dataSource:'fangWuList',
            items: [
                {height: 4, title: '房屋代码',colSpan: 2, print: true,dataIndex:'FWDM', align: 'center'},
                {align: 'center',dataIndex:'SH',title:'室号'},
                {
                    title: '面积',
                    align: 'center',
                    dataIndex:'MJ',
                    print: true
                },
                {colSpan: 3, align: 'center',dataIndex:'JCBZ',title:'交存标准(元/m²)'},
                {colSpan: 2,align: 'center',dataIndex:'JCJE',title:'交存金额(元)'},
            ]
        }

    ],
    scale:1.4,
    loadData:function loadData(data)
    {
        var me = this;
        //console.log(this.data.fangWuList.length);
        setTimeout(function () {
            /*
            *  
           format: "CODE39",//选择要使用的条形码类型
           width:3,//设置条之间的宽度
           height:100,//高度
           displayValue:true,//是否在条形码下方显示文字
           text:"456",//覆盖显示的文本
           fontOptions:"bold italic",//使文字加粗体或变斜体
           font:"fantasy",//设置文本的字体
           textAlign:"left",//设置文本的水平对齐方式
           textPosition:"top",//设置文本的垂直位置
           textMargin:5,//设置条形码和文本之间的间距
           fontSize:15,//设置文本的大小
           background:"#eee",//设置条形码的背景
           lineColor:"#2196f3",//设置条和文本的颜色。
           margin:15//设置条形码周围的空白边距
            * */
            try {
                JsBarcode("#shengdingdanhao", me.data['barcode'], {
                    // format:"EAN13",
                    displayValue:true,
                    width:2,
                    height:30,
                    fontSize:18,
                    lineColor: "#0cc"
                });
            }catch (e) {
                console.error(e);
            }


        },100);
        var _data = this.data||{};
        var list = _data.fangWuList ||[];
        this.height = 350 + list.length*20;
        this.callParent(data);
    }
});